package edu.utdallas.cs.securechat.main;

import java.net.InetAddress;
import java.security.Key;

import javax.crypto.SecretKey;

public class ClientSession {
	String user;
	byte[] authentication;
	SecretKey sessionKey;
	long expiration;
	Boolean confirmed;
	InetAddress address;
	Key publicKey;
	
	public ClientSession(String user, byte[] auth, SecretKey key, long e){
		this.user = user;
		this.authentication = auth;
		this.sessionKey = key;
		this.expiration = e;
		this.confirmed = false;		
	}
		
	public ClientSession(String user, SecretKey key, Key userPublic, long e, Boolean c){
		this.user = user;
		this.sessionKey = key;
		this.expiration = e;
		this.confirmed = c;
		this.publicKey = userPublic;
	}
	
	public String getUser(){
		return this.user;
	}
		
	public SecretKey getKey(){
		return this.sessionKey;
	}
	
	public byte[] getAuth(){
		return this.authentication;
	}
	
	public Key getPublicKey(){
		return this.publicKey;
	}
	
	public void setPublicKey(Key publicKey){
		this.publicKey = publicKey;
	}
	
	public void setAddress(InetAddress address){
		this.address = address;
	}
	
	public InetAddress getAddress(){
		return this.address;
	}
	
	public void confirm(){
		this.confirmed=true;
	}
	
	public long getExpiration(){
		return this.expiration;
	}
	
	public Boolean isConfirmed(){
		return this.confirmed;
	}
	
	public void setKey(SecretKey key){
		this.sessionKey = key;
	}
}
